<template>
  <div class="flow-row">
    <div class="flow-box">
      <div class="flow-item flow-node-branch">
        <div class="flow-branch-suggest">
          <div class="node-name">
            <EditName v-model="state.name"/>
            <!--
            <SvgIcon  name="ele-Tools" :size="20" style="margin-left: 10px;"  />
            -->
          </div>
          <!--  <div class="close-icon"><a-icon type="close-circle" @click.stop="!read && delNode(node)" /></div> -->
        </div>
      </div>
      <!-- 如果子节点是意见分支,则只能添加一个意见分支 -->
      <FlowAddNode :node="node" :nodeType="node.type" />
    </div>
  </div>
</template>
<script lang="ts" setup name="ServiceFlowPolymerizeNode">
  import FlowAddNode from '../../add/index.vue';
  import EditName from '../../common/ServiceEditName.vue';
  //------------------接收传入参数------------------------
  const props = defineProps({
    node: {
      type: Object,
      default: function() {
        return {};
      },
    },

  });
  const state=reactive({
    isActive: false,
    name:props.node.name
  })
  watch(
    () => state.name,
    (val: any) => {
      // 将对应的审批节点的添加按钮开启
      let currNode = {
        id: node.id,
      };
      $store.serviceFlow.UP_NODE( { currNode, field: 'name', value: val });
    },
    {
      deep: true,
    }
  );
</script>
